package cn.klaw.emnus;

/**
 * 连接关系枚举
 *
 *
 * @version v5.1.0
 *
 * @date 2024/9/12 9:36:05
 */
public enum DsJoinTypeEnum {
    LEFT_JOIN(1, "LEFT JOIN", "左连接"),

    RIGHT_JOIN(2, "LEFT JOIN", "右连接"),

    INNER_JOIN(3, "INNER JOIN", "内连接"),

    FULL_JOIN(4, "FULL JOIN", "全连接");

    private Integer type;
    private String code;
    private String fullName;

    DsJoinTypeEnum(Integer type, String code, String fullName) {
        this.type = type;
        this.code = code;
        this.fullName = fullName;
    }

    public Integer getType() {
        return type;
    }

    public String getCode() {
        return code;
    }

    public String getFullName() {
        return fullName;
    }

    public static String getCodeByType(Integer type) {
        String code = null;
        switch (type) {
            case 1:
                code = LEFT_JOIN.getCode();
                break;
            case 2:
                code = RIGHT_JOIN.getCode();
                break;
            case 3:
                code = INNER_JOIN.getCode();
                break;
            case 4:
                code = FULL_JOIN.getCode();
                break;
            default:
                code = LEFT_JOIN.getCode();
                break;
        }
        return code;
    }
}
